import 'package:im_demo/app/data/chat/action_type.dart';
import 'package:im_demo/app/data/chat/message_type.dart';
import 'package:im_demo/app/data/chat/message_type_converter.dart';
import 'package:json_annotation/json_annotation.dart';

part 'single_message.g.dart';

@JsonSerializable(explicitToJson: true, anyMap: true)
class SingleMessage {
  final int userId;
  final String messageType;
  final int targetUserId;
  @JsonKey(includeIfNull: false)
  final String? message;
  // final ActionType? actionType;

  SingleMessage({
    required this.userId,
    required this.messageType,
    required this.targetUserId,
    this.message,
    // this.actionType,
  });

  factory SingleMessage.fromJson(Map<String, dynamic> json) =>
      _$SingleMessageFromJson(json);

  Map<String, dynamic> toJson() => _$SingleMessageToJson(this);
}
